<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>首页</title>
	<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css" media="all">
	<link rel="stylesheet" type="text/css" href="../css/hou.css" media="all">
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script type="text/javascript" src="../js/bootstrap.min.js"></script>
	<style type="text/css">
		.menu{
			background-color: #D9EDF7;
		}
	</style>
</head>
<body>
	<div class="container">
		<%@include file="include/top.jsp" %>
		<div class="content">
			<%@include file="include/left.jsp" %>
			
			<div class="right pull-right">
				<div class="navbar" style="width:790px;margin-bottom:0px;">
					<div class="navbar-inner">
					  <a class="brand" href="javascript:;">最新订单</a>
					</div>			
				</div>
				<div class="well" style="padding:5px;">
					<table class="table table-striped" style="border:1px solid #ccc">
						<tbody style="padding:10px;">
							<tr>
								<td>#</td>
								<td style="width:100px;height:37px;">订单号</td>
								<td>书名</td>
								<td>下单用户</td>
								<td>订单状态</td>
								<td>创建时间</td>
							</tr>
							<c:choose>
								<c:when test="${not empty orderList}">
									<c:forEach items="${orderList}" var="order" varStatus="s">
										<tr>
											<td>${s.count}</td>
											<td>${order.ordernum}</td>
											<td style="width:100px;height:37px;">${order.shopcar.book.bookName}</td>
											<td>${order.user.username}</td>
											<td>
												<c:choose>
													<c:when test="${order.state=='已确认'}">
														<span class="label label-info">${order.state}</span>
													</c:when>
													<c:when test="${order.state=='已完成'}">
														<span class="label label-success">${order.state}</span>
													</c:when>
													<c:when test="${order.state=='配送中'}">
														<span class="label label-warning">${order.state}</span>
													</c:when>
													<c:when test="${order.state=='未发货'}">
														<span class="label label-inverse">${order.state}</span>
													</c:when>
												</c:choose>
											</td>
											<td>${order.createtime}</td>
										</tr>
									</c:forEach>
								</c:when>
								<c:otherwise>
									<div class="alert alert-info">
									  <button type="button" class="close" data-dismiss="alert">&times;</button>
									  <strong>暂时没有订单</strong>
									</div>
								</c:otherwise>
							</c:choose>
							
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</body>
</html>